package cn.good.yan.controller;

import cn.hutool.core.util.IdUtil;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * 演示 Micrometer 链路跟踪
 *
 * @author shengren.yan
 * @create 2024-05-04
 */
@RestController
public class PayMicrometerController {

    /**
     * Micrometer(Sleuth) 进行链路监控的例子
     *
     * @param id
     * @return
     */
    @GetMapping(value = "/m/test/{id}")
    public String test1(@PathVariable("id") Integer id) {
        return "Hello, 链路跟踪 inputId:  " + id + " \t    服务返回:" + IdUtil.simpleUUID();
    }

}

